<!DOCTYPE HTML>
<html lang="en" >
    <!-- Start book Git简介 -->
    <head>
        <!-- head:start -->
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>创建项目分支 | Git简介</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../part2/6.html" />
    
    
    <link rel="prev" href="../part2/4.html" />
    

        <!-- head:end -->
    </head>
    <body>
        <!-- body:start -->
        
    <div class="book"
        data-level="2.4"
        data-chapter-title="创建项目分支"
        data-filepath="part2/5.md"
        data-basepath=".."
        data-revision="Fri Sep 08 2017 10:45:34 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        GIT简介
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="1.html">
            
                
                    <a href="../1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        安装配置
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2" data-path="part2/1.html">
            
                
                    <a href="../part2/1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        经理-创建
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="part2/2.html">
            
                
                    <a href="../part2/2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        创建仓库
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="part2/3.html">
            
                
                    <a href="../part2/3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        添加ssh账户
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="part2/4.html">
            
                
                    <a href="../part2/4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        克隆项目
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="2.4" data-path="part2/5.html">
            
                
                    <a href="../part2/5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        创建项目分支
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="part2/6.html">
            
                
                    <a href="../part2/6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        搭建项目框架
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="part2/7.html">
            
                
                    <a href="../part2/7.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        上传分支
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="part3/1.html">
            
                
                    <a href="../part3/1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        员工-开发
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="part3/2.html">
            
                
                    <a href="../part3/2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        添加ssh账户
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="part3/3.html">
            
                
                    <a href="../part3/3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        本地克隆
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="part3/4.html">
            
                
                    <a href="../part3/4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        同步分支
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="part3/5.html">
            
                
                    <a href="../part3/5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        开发管理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="part3/6.html">
            
                
                    <a href="../part3/6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        工作区与暂存区
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="part3/7.html">
            
                
                    <a href="../part3/7.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        暂存区与仓库区
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="part3/8.html">
            
                
                    <a href="../part3/8.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        本地与服务器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="part3/9.html">
            
                
                    <a href="../part3/9.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.8.</b>
                        
                        历史
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="part3/10.html">
            
                
                    <a href="../part3/10.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.9.</b>
                        
                        删除
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.10" data-path="part3/11.html">
            
                
                    <a href="../part3/11.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.</b>
                        
                        Debug分支
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="4.html">
            
                
                    <a href="../4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        经理-发布
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5" data-path="5.html">
            
                
                    <a href="../5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        总结与作业
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >Git简介</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x521B;&#x5EFA;&#x9879;&#x76EE;&#x5206;&#x652F;">&#x521B;&#x5EFA;&#x9879;&#x76EE;&#x5206;&#x652F;</h1>
<ul>
<li>&#x6BCF;&#x4E2A;&#x5458;&#x5DE5;&#x5F00;&#x53D1;&#x671F;&#x7684;&#x4EE3;&#x7801;&#x4E92;&#x4E0D;&#x5E72;&#x6270;&#xFF0C;&#x5E76;&#x884C;&#x5F00;&#x53D1;&#xFF0C;&#x5219;&#x6BCF;&#x4EBA;&#x4F7F;&#x7528;&#x4E00;&#x6761;&#x5206;&#x652F;</li>
<li>&#x9879;&#x76EE;&#x5F00;&#x53D1;&#x4E2D;&#x516C;&#x7528;&#x5206;&#x652F;&#x5305;&#x62EC;master&#x3001;dev<ul>
<li>&#x5206;&#x652F;master&#x7528;&#x4E8E;&#x53D1;&#x5E03;&#xFF0C;&#x9ED8;&#x8BA4;&#x5206;&#x652F;&#xFF0C;&#x5F53;&#x9700;&#x8981;&#x53D1;&#x5E03;&#x65F6;&#x5C06;dev&#x5206;&#x652F;&#x5408;&#x5E76;</li>
<li>&#x5206;&#x652F;dev&#x5F00;&#x53D1;&#x9636;&#x6BB5;&#x6027;&#x7684;&#x4EE3;&#x7801;&#x5408;&#x5E76;&#xFF0C;&#x6BCF;&#x4E2A;&#x9636;&#x6BB5;&#x7684;&#x5DE5;&#x4F5C;&#x5B8C;&#x6210;&#x540E;&#x9700;&#x8981;&#x8FDB;&#x884C;&#x4E00;&#x6B21;&#xFF0C;&#x63A7;&#x5236;&#x9879;&#x76EE;&#x7684;&#x8FDB;&#x5EA6;</li>
<li>&#x6210;&#x5458;&#x5206;&#x652F;&#x7528;&#x4E8E;&#x6BCF;&#x4E2A;&#x9879;&#x76EE;&#x6210;&#x5458;&#x7684;&#x4EE3;&#x7801;&#x5F00;&#x53D1;&#xFF0C;&#x5B9E;&#x73B0;&#x4E0D;&#x4EA4;&#x53C9;</li>
</ul>
</li>
<li>&#x521B;&#x5EFA;&#x5206;&#x652F;</li>
</ul>
<pre><code>git branch &#x5206;&#x652F;&#x540D;&#x79F0;
&#x4F8B;&#xFF1A;
git branch dev
</code></pre><ul>
<li>&#x5207;&#x6362;&#x5206;&#x652F;</li>
</ul>
<pre><code>git checkout &#x5206;&#x652F;&#x540D;&#x79F0;
&#x4F8B;&#xFF1A;
git checkout dev
</code></pre><ul>
<li>&#x5C06;&#x5206;&#x652F;&#x63A8;&#x9001;&#x5230;&#x670D;&#x52A1;&#x5668;</li>
</ul>
<pre><code>git push origin &#x5206;&#x652F;&#x540D;&#x79F0;
&#x4F8B;&#xFF1A;
git push origin dev
</code></pre><ul>
<li>&#x5C06;&#x672C;&#x5730;&#x5206;&#x652F;&#x8DDF;&#x8E2A;&#x670D;&#x52A1;&#x5668;&#x5206;&#x652F;</li>
</ul>
<pre><code>git branch --set-upstream-to=origin/&#x5206;&#x652F;&#x540D;&#x79F0; &#x5206;&#x652F;&#x540D;&#x79F0;
&#x4F8B;&#xFF1A;
git branch --set-upstream-to=origin/dev dev
</code></pre><ul>
<li>&#x521B;&#x5EFA;&#x5E76;&#x5207;&#x6362;&#x5206;&#x652F;</li>
</ul>
<pre><code>git checkout -b &#x5206;&#x652F;&#x540D;&#x79F0;
&#x4F8B;&#xFF1A;
git checkout -b itcast
</code></pre><ul>
<li>&#x67E5;&#x770B;&#x6240;&#x6709;&#x5206;&#x652F;&#xFF0C;&#x5F53;&#x524D;&#x5206;&#x652F;&#x524D;&#x6807;&#x8BB0;&#x4E3A;&#x661F;*</li>
</ul>
<pre><code>git branch
</code></pre><p><img src="images/git4_1.png" alt="&#x67E5;&#x770B;&#x5206;&#x652F;"></p>
<ul>
<li>&#x5220;&#x9664;&#x5206;&#x652F;</li>
</ul>
<pre><code>git branch -d &#x5206;&#x652F;&#x540D;&#x79F0;
&#x6CA1;&#x6709;&#x4F8B;&#x5B50;&#xFF0C;&#x6CA1;&#x9519;&#xFF0C;&#x5C31;&#x662F;&#x6CA1;&#x6709;&#x4F8B;&#x5B50;&#xFF0C;&#x5982;&#x679C;&#x4F60;&#x5220;&#x9664;&#x4E86;&#xFF0C;&#x6211;&#x4E5F;&#x627E;&#x4E0D;&#x56DE;&#x6765;&#x54DF;
</code></pre>
                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../part2/4.html" class="navigation navigation-prev " aria-label="Previous page: 克隆项目"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../part2/6.html" class="navigation navigation-next " aria-label="Next page: 搭建项目框架"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"toggle-chapters":{},"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        <!-- body:end -->
    </body>
    <!-- End of book Git简介 -->
</html>
